﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Linq.Expressions;
using Wedo.Recognition.Domain.Models;

namespace Wedo.Service.Common
{
    public  interface IBaseService<T> where T:class
    {

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
         T Add(T entity);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="entity"></param>
         T Update(T entity);

        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="id"></param>
         void Remove(object id);

        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="where"></param>
         IQueryable<T> GetAll(Expression<Func<T, bool>> where=null, string includes=null);

        /// <summary>
        /// 根据ID查询对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
         T GetById(object id);
    }
}
